package com.learningpattern.factory.simplefactory;

import com.learningpattern.factory.CSGame;
import com.learningpattern.factory.DOTAGame;
import com.learningpattern.factory.IGame;
import com.learningpattern.factory.LOLGame;

public class GameFactoryDemo {
    public static void main(String[] args) {
        GameFactory factory=new GameFactory();
      /*  IGame game=factory.create("LOL");
        game.paly();
        game=factory.create("DOTA");
        game.paly();
        game=factory.create("CS");
        game.paly();*/
         /* IGame game=factory.create("com.learningpattern.factory.LOLGame");
        game.paly();
        game=factory.create("com.learningpattern.factory.DOTAGame");
        game.paly();
        game=factory.create("com.learningpattern.factory.CSGame");
        game.paly();*/
        IGame game = factory.create(CSGame.class);
         game.paly();
         game = factory.create(LOLGame.class);
         game.paly();;
         game = factory.create(DOTAGame.class);
         game.paly();

    }
}
